home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-12-20 | 3.0 KB | 130 lines | [TEXT/MSET] |
- \ 03Nov95 JRF Disable active window before alert in TESizeCheck
- \ 15May93 DBH Change echovec per mrh. Separate TEScroller and TEwind code
- \ into different files. Implement lineEnd: method in intepret:
- \ 14May93 DBH Dropped new: and test: methods.
- \ Added enable: and disable: methods
- \ Reworked interpret: to eliminate local variables.
- \ Made theTEScroller an ivar. Lock: and unlock: buffer in interpret:
- \ Sept93 mrh revised for new controls scheme.
-
-
- need TEScroller
- need alert
-
-
- \ we will use TEalert when the TE size gets too large
-
- 1 alert TEalert
-
-
- : TESizeCheck ( n -- )
- 32000 > \ we actually send up an alert a bit sooner than
- \ absolutely necessary
- IF
- " Too much text in this window! Delete text to continue."
- " Thanks"
- " " " " paramText
- ActW dup IF disable: [] ELSE drop THEN \ Disable window first
- 900 StopAlert disp: TEalert \ Alert w/ Stop icon
- drop quit \ Back to event loop
- THEN ;
-
-
- :class TEwind super{ window+ }
-
- handle BUFFER \ merely a place to manipulate the TEscrap handle
-
- \ Dec95 JRF following 3 methods brought in slightly altered from supers
-
- :m SetContViewBounds: { \ l t r b -- }
- getRect: super -> b -> r -> t -> l
- l t r 1+ b 1+ setBounds: [ get: ^contView ] drawgrow: self
- moved: [ get: ^contView ]
- 0 0 32000 dup put: tempRect update: tempRect ;m
-
- :m ZOOM: { part -- }
- word0 ^base whrFEv
- part makeint call TrackBox i->l
- IF getRect: self put: tempRect tempRect call EraseRect
- ^base part makeint word0 call ZoomWindow
- setcontviewbounds: self
- THEN ;m
-
- :m GROW: \ Handles a mouse-down in the grow box.
- get: growFlg
- IF setLimits: self \ Omit in subclasses which need
- \ custom grow limits
- 0 ^base whrFEv addr: growrect
- call GrowWindow ?dup
- IF unpack size: self ( draw: self )
- penIntoWind: self
- setcontviewbounds: self
- THEN
- ELSE
- ^base call SelectWindow
- THEN
- update: self ;m
-
-
- :m CUT:
- get: ^contView cut: TEscroller
- get: ^contView fixPanRect: TEscroller
- get: ^contView caretIntoView: TEscroller ;m
-
- :m COPY:
- get: ^contView copy: TEscroller ;m
-
-
- :m PASTE:
- global TEScrpHandle @ put: buffer size: buffer
- get: ^contView size: TEScroller + TESizeCheck
- get: ^contView paste: TEscroller
- get: ^contView fixPanRect: TEscroller
- get: ^contView caretIntoView: TEscroller ;m
-
-
- :m CLEAR:
- get: ^contView clear: TEscroller
- get: ^contView fixPanRect: TEscroller
- get: ^contView caretIntoView: TEscroller ;m
-
-
- :m key: \ ( char -- )
- noclip
- CASE[ 8 ( delete ) ]=> 8 get: ^contView key: TEscroller
- DEFAULT=> get: ^contView size: TEscroller 1+ TESizeCheck
- get: ^contView key: TEscroller
- ]CASE
- ;m
-
-
- :m INSERT: { addr len -- }
- get: ^contView size: TEscroller len + TESizeCheck
- addr len get: ^contView insert: TEscroller ;m
-
-
- ;class
-
- endload
-
-
- \ TESTING:
-
- TEwind TW
- TEscroller S1 \ This will be the contview of TW
-
- screenbits true setGrow: tw
- true setZoom: tw
-
-
- : GO
- s1 test: tw
- eventLoop ;
-
-
- : GORES \ Test getting things from a resource file
- 256 s1 getNew: tw ;
-
- : ZZ set: fwind close: tw ;
-
-